<template>
  <div class="right-container">
    <h3>Right 组件</h3>
    <p>{{ message }}</p>
    <p>{{ count }}</p>
    <button @click="add">+1</button>
  </div>
</template> 

<script>
import bus from '@/utils/eventBus'
export default {
  props:{
    message:String
  },
  data(){
    return {
      count:1
    }
  },
  methods:{
    add(){
    this.count++
    this.$emit('count',this.count)

    bus.$emit('share',this.count)
  }
  }
 
}
</script>

<style lang="less">
.right-container {
  padding: 0 20px 20px;
  background-color: lightskyblue;
  min-height: 250px;
  flex: 1;
}
</style>
